﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DONGACS.Assembler;
using DONGACS.DAO;
using DONGACS.Domain;
using DONGACS.DTO;

namespace DONGACS.SERVICE
{
    public class PathsService
    {
        PathsAssembler PathsAssembler = new PathsAssembler();
        PathsDao PathsDao = new PathsDao();


        public IList<PathsDto> GetAllPaths()
        {
            IList<Paths> PathsList = PathsDao.GetAllPaths();

            IList<PathsDto> PathsDtoList = PathsAssembler.ConvertToDataTransferObjectList(PathsList);

            return PathsDtoList;
        }

        public PathsDto GetPathsByPathId(string pathID)
        {
            Paths paths = PathsDao.GetPathsByID(pathID);

            PathsDto pathsDto = PathsAssembler.ConvertToDataTransferObject(paths);

            return pathsDto;
        }

        public IList<Object> GetAllBlocksInPaths()
        {
            IList<Object> list = PathsDao.GetAllBlocksInPaths();

            return list;
        } 
        
        public IList<Object> GetAllModulesInPaths()
        {
            IList<Object> list = PathsDao.GetAllModulesInPaths();

            return list;
        }

        public IList<Object> GetAllModulesInPathsByBlocks(string block)
        {
            IList<Object> list = PathsDao.GetAllModulesInPathsByBlocks(block);

            return list;
        }

        public IList<PathsDto> GetAllPathsByModulesAndPermissionType(string module, string permissionsType)
        {
            IList<Paths> PathsList = PathsDao.GetAllPathsByModulesAndPermissionType(module,permissionsType);

            IList<PathsDto> PathsDtoList = PathsAssembler.ConvertToDataTransferObjectList(PathsList);

            return PathsDtoList;
        }

        public PathsDto GetPathsByModulesAndPermissionType(string module, string permissionsType)
        {
            Paths paths = PathsDao.GetPathsByModulesAndPermissionType(module, permissionsType);

            PathsDto PathsDto = PathsAssembler.ConvertToDataTransferObject(paths);

            return PathsDto;
        }

        public IList<object> GetAllModuleInPaths()
        {
            return this.PathsDao.GetAllModulesInPaths();
        }
        
    }
}
